var url="";
var model;
var request;
var Rank;
var result=false;
function LoadData(){
  result=false;
    request.post('http://'+url+'/app/EnergyRank!ajaxEnergyRank?orderType='+model.type).success(function(data){
      console.log(data);
        if(data!=null&&data.length==0){
           $("body").html("<div style='margin:100px auto;width:200px;height:100px;position: relative;text-align:center;'><img  style='position: relative;' src='image/nodata.png' width='62' height='66'/><br/><span style='font-size:14px;color:rgb(141,141,141);'>没有相关内容!</span></div>");

         }else
         {
              
         }
         model.list = data;

           result=true;
         }).error(function(data,status,headers,config){
      if((status>=200&&status<300)||status===304||status===1223||status===0){
      $("body").html("网络访问出错！");
      }
      });
}

(function(){
	var app=angular.module('Rank',[ ]);
	app.controller('RankController',['$http','$window',function($http,$window){
        Rank=this;
		request=$http;
    model=Rank;
    url ='120.26.110.125/jncloud';
    Rank.type=GetQueryString("type");
    bindEvent();
    LoadData();
    Rank.gotoProject=function(id){
      client.gotoProject(id);
    }
	}]);
})();
